Fix a crasher that was introduced by 9ca802161ec6387419d160f21fe477008a567477
authorCody Russell <cody@jhu.edu>
Thu, 15 Aug 2013 20:08:34 +0000 (15:08 -0500)
committerCody Russell <cody@jhu.edu>
Thu, 15 Aug 2013 20:08:34 +0000 (15:08 -0500)
due to preedit_str being initialized as an empty string rather than NULL.

modules/input/imquartz.c

index 9e42d8fcfa18c5f8e0511652a7c1d6096c01f5c5..06ebc6837b2517bec8937ede303b26b6c23e9ae0 100644 (file)
@@ -230,7 +230,7 @@ discard_preedit (GtkIMContext *context)
   NSInputManager *currentInputManager = [NSInputManager currentInputManager];
   [currentInputManager markedTextAbandoned:nsview];
 
-  if (qc->preedit_str)
+  if (qc->preedit_str && strlen (qc->preedit_str) > 0)
     {
       g_signal_emit_by_name (context, "commit", qc->preedit_str);